import 'package:flutter/material.dart';

class EchoRoute extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    //获取路由参数
    var args=ModalRoute.of(context)?.settings.arguments;

    return Scaffold(
        appBar: AppBar(
          title: Text("Echo route"),
        ),
        body: Center(
          child:TextButton(
              child: Text("This is echo route \n $args",textAlign: TextAlign.center,),
              onPressed: () {
                Navigator.pop(context, "我是 EchoRoute 返回值");
              }
          ),
        )
    );
  }

}